C++中将string类型转化为int类型 写程序需要将string转化为int,所以就探索了一下。 方法一:atoi函数 atoi函数将字符串转化为整数,注意需要stdlib库。所以就尝试了一下: ...